<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
		<title>导游注册</title>
		<link rel="stylesheet" type="text/css" href="__CSS__/index.css" />
		<script src="__JS__/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="__JS__/node_modules/vue/dist/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="__JS__/node_modules/axios/dist/axios.js" type="text/javascript" charset="utf-8"></script>
		<script src="__JS__/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="tourist" style="background-color: #F7F8F9;min-height: 100vh;">
			<div class="page-title">
				导游注册
			</div>
			<div class="form">
				<div class="form-div">
					<div class="form-label">
						真实姓名
					</div>
					<input type="text" class="form-input" v-model="user_name" placeholder="请输入真实姓名" />
				</div>
				<div class="form-div">
					<div class="form-label">
						手机号
					</div>
					<input type="text" class="form-input"  v-model="mobile" placeholder="请输入手机号码" />
				</div>
				<div class="form-div">
					<div class="form-label">
						导游证号
					</div>
					<input type="text" class="form-input" v-model="id_card" placeholder="请输入真是的导游证号" />
				</div>
			</div>
			<div class="submit-btn" @click="postForm">
				提交审核
			</div>
		</div>
	</body>
</html>
<script>
new Vue({
	el:"#tourist",
	data(){
		return{
				user_name:"",
				mobile:"",
				id_card:"",
		}
	},
	created() {
		
	},
	methods:{
		postForm:function(){
                 var url = "stourist";
                 var _this = this;
                 // post有两个参数
                 //参数1:请求的路径
                 //参数2:提交的参数
                 //提交参数的两种形态:
                 //          1.可以直接传入字符串 name=张三&age=19
                 //          2.可以以对象的形式传入{name:"三",age:19}
                 axios.post(url,{name:_this.user_name,iphone:_this.mobile,id_card:_this.id_card}).then(function(res) {
                    var resData = res.data;
                    console.log(res)
                    if(resData.status == "200") { //0表示成功，1表示失败    
                         console.log('提交成功');
                    }else{
                         console.log('提交失败');
                         alert(resData.msg);
                    } 
                 });

   			//console.log(this.user_name,this.mobile,this.id_card)
		},

	}
})



</script>
